package main

import "fmt"

func getAverage(arr []float32) float32 {
	var i int
	var sum float32
	for i = 0; i < len(arr); i++ {
		sum += arr[i]
	}
	return sum / float32(len(arr))
}

func main() {
	var ar [10]int
	for i := 0; i < len(ar); i++ {
		fmt.Println(ar[i])
	}

	var balance = []float32{1000.0, 2.0, 3.4, 7.0, 50.0}

	fmt.Println(balance)

	for j := 0; j < len(balance); j++ {
		fmt.Println(balance[j])
	}

	fmt.Println("----------------------------------------")
	fmt.Println(fmt.Sprintf("%.2f", getAverage(balance)))
	fmt.Println("----------------------------------------")
	a := [...]int{1, 2, 3, 4}
	//p := &a
	var p *[4]int
	p = &a
	fmt.Println(len(*p))
	fmt.Println((*p)[2])

}
